﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace DataTier
{
    [KnownType(typeof(BatteryModel))]
    [DataContract(IsReference = true)]
    public class CarModel
    {
        private BatteryModel _batteryModel; 
        private string _description;
        private int _kmOnFullCharge;
        private int _carModelId;

        #region Constructors

        public CarModel(int carModelId, string description, int kmOnFullCharge)
        {
            this._carModelId = carModelId;
            this._description = description;
            this._kmOnFullCharge = kmOnFullCharge;
        }

        public CarModel(string desc)
        {
            this._description = desc;
        }

        public CarModel(int id)
        {
            this._carModelId = id;
        }

        #endregion

        #region Properties

        [DataMember]
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        [DataMember]
        public int KmOnFullCharge
        {
            get { return _kmOnFullCharge; }
            set { _kmOnFullCharge = value; }
        }

        [DataMember]
        public int CarModelId
        {
            get { return _carModelId; }
            set { _carModelId = value; }
        }

        [DataMember]
        public BatteryModel BatteryModel
        {
            get { return _batteryModel; }
            set { _batteryModel = value; }
        }

        #endregion
    }
}
